package com.htsk.city.services.core.domain;


import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;
import lombok.Setter;

import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.Date;

@Getter
@Setter
@Entity
@Table(name = "order_review")
public class OrderReview {
    /**
     * id	评价ID
     * order_id	订单ID
     * user_id	用户ID
     * technician_id	师傅id
     * service_sub_category_name	服务子类型名称
     * rating	评分(1-5分)
     * content	评价内容
     * images	评价图片(JSON数组存储图片URL)
     * technician_rating	师傅评分
     * service_rating	服务评分
     * status	状态(0-隐藏,1-显示,2-审核中)
     * is_anonymous	是否匿名(0-否,1-是)
     * is_replied	师傅是否回复(0-否,1-是)
     * reply_content	师傅回复内容
     * reply_time	师傅回复时间
     * created_at	创建时间
     * updated_at	更新时间
     */
    @Id
    @Column(name = "id", nullable = false)
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;
    @Column(name = "order_id")
    private Long orderId;
    @Column(name = "user_id")
    private Long userId;
    @Column(name = "technician_id")
    private Long technicianId;
    @Column(name = "service_sub_category_name")
    private String serviceSubCategoryName;
    @Column(name = "content")
    private String content;
    @Column(name = "images")
    private String images;
    @Column(name = "technician_rating")
    private Integer technicianRating;
    @Column(name = "service_rating")
    private Integer serviceRating;
    @Column(name = "status")
    private Integer status;
    @Column(name = "is_anonymous")
    private Integer isAnonymous;
    @Column(name = "is_replied")
    private Integer isReplied;
    @Column(name = "reply_content")
    private String replyContent;
    @Column(name = "reply_time")
    @JsonFormat(shape = JsonFormat.Shape.NUMBER)
    private Date replyTime;
    @Column(name = "created_at")
    @JsonFormat(shape = JsonFormat.Shape.NUMBER)
    private Date createdAt;
    @Column(name = "updated_at")
    @JsonFormat(shape = JsonFormat.Shape.NUMBER)
    private Date updatedAt;
}
